home *** CD-ROM | disk | FTP | other *** search
- Path: newdelph.cig.mot.com!usenet
- From: Martin O'Hara <oharam>
- Newsgroups: comp.lang.c++
- Subject: Question: outLined inlines/ Vtab replication
- Date: 8 Mar 1996 09:56:37 GMT
- Organization: Motorola Cellular Infrastructure Group
- Message-ID: <4hp08l$5sd@newdelph.cig.mot.com>
- NNTP-Posting-Host: liath202.cork.cig.mot.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1 (X11; I; SunOS 4.1.3_U1 sun4m)
- X-URL: news:comp.lang.c++
-
- I have a couple of questions that Im not 100 percent on
-
- If a function is declared inline by the programmer but the address of this
- function is taken in the code somewhere then the compiler will generate a
- callable function. This may also happpen if the inline is recursive or too big.
-
- Q. Is a copy of such a function placed in each translation unit in which it is
- needed ( code duplication). Is this an "outlined inline"?
-
- Q. Can there exist inline expanded code representing the function and also a
- callable version of the function in different parts of a program.? Or will the
- compiler decide that if all occorrences of the function cannot be inline
- expanded then the function will just be a normal one?
-
- I also have a question regarding VTABs
-
- The C++ standard states that smart compilers will look for the first non inline
- virtual function definition of a class and place one copy of the VTAB in that
- translation unit. In what cases will the VTAB be replicated (anywhere the class
- h file is included) by a smart compiler.
- A. If there are no non inline virtuals?
- B If there are no non virtual functions in the class (C++ standard)?
-
- /M
-
-